package com.situ.mall.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.situ.mall.entity.Product;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);
    
    List<Product> selectAll();

    int getTotalCount(Product product);

	List<Product> selectByPage(@Param(value = "offset")int offset, 
			@Param(value = "limit")Integer limit,
			@Param(value = "product")Product product);

	List<Product> selectByName(String name);
	
	//看分类下有多少条数据
	int getTotalCountByCategoryId(Integer categoryId);

	//看该分类的数据
	List<Product> selectProductByCategoryId(@Param(value = "categoryId")Integer categoryId, @Param(value = "offset")int offset, @Param(value = "limit")Integer limit);

	Product selectProductById(int id);

	List<Product> selectProductByMaybeYLike(Integer categoryId);

	List<Product> selectProductByMaybeYLike(@Param(value = "categoryId")Integer categoryId, @Param(value = "id")int id);

	List<Product> selectNew(@Param(value = "page")int page, @Param(value = "limit")Integer limit);

	List<Product> selectCheap(@Param(value = "page")int page, @Param(value = "limit")Integer limit);

	List<Product> selectTop(@Param(value = "page")int page, @Param(value = "limit")Integer limit,@Param(value = "categoryId")Integer categoryId);

	int getTotalCountByLikeName(String name);

	List<Product> selectProductByLikeName(@Param(value = "name")String name, @Param(value = "offset")Integer offset, @Param(value = "limit")Integer limit);

	
}